<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Dingo.pubsub._TopicTreeNode</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="Dingo-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/dingo-wsn/">Dingo</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="Dingo-module.html">Package&nbsp;Dingo</a> ::
        <a href="Dingo.pubsub-module.html">Module&nbsp;pubsub</a> ::
        Class&nbsp;_TopicTreeNode
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="Dingo.pubsub._TopicTreeNode-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class _TopicTreeNode</h1><br /><br />
<center>
<center>  <map id="uml_class_diagram_for_dingo_pu" name="uml_class_diagram_for_dingo_pu">
<area shape="rect" href="Dingo.pubsub._TopicTreeRoot&#45;class.html" title="The root of the tree knows how to access other node of the tree and is the gateway of the tree user to the tree nodes." alt="" coords="111,291,217,317"/>
<area shape="rect" href="Dingo.pubsub._TopicTreeNode&#45;class.html#getCallables" title="Get callables associated with this topic node" alt="" coords="17,36,311,55"/>
<area shape="rect" href="Dingo.pubsub._TopicTreeNode&#45;class.html#hasSubtopic" title="Return true only if topic string is one of subtopics of this node" alt="" coords="17,55,311,73"/>
<area shape="rect" href="Dingo.pubsub._TopicTreeNode&#45;class.html#__str__" title="Print us in a not&#45;so&#45;friendly, but readable way, good for debugging." alt="" coords="17,73,311,92"/>
<area shape="rect" href="Dingo.pubsub._TopicTreeNode&#45;class.html#getPathname" title="The complete node path to us, ie., the topic tuple that would lead to us" alt="" coords="17,92,311,111"/>
<area shape="rect" href="Dingo.pubsub._TopicTreeNode&#45;class.html#clearCallables" title="Abandon list of callables to caller." alt="" coords="17,111,311,129"/>
<area shape="rect" href="Dingo.pubsub._TopicTreeNode&#45;class.html#hasCallable" title="Return true if callable in this node" alt="" coords="17,129,311,148"/>
<area shape="rect" href="Dingo.pubsub._TopicTreeNode&#45;class.html#addCallable" title="Add a callable to list of callables for this topic node" alt="" coords="17,148,311,167"/>
<area shape="rect" href="Dingo.pubsub._TopicTreeNode&#45;class.html#__init__" title="Dingo.pubsub._TopicTreeNode.__init__" alt="" coords="17,167,311,185"/>
<area shape="rect" href="Dingo.pubsub._TopicTreeNode&#45;class.html#sendMessage" title="Send a message to our callables" alt="" coords="17,185,311,204"/>
<area shape="rect" href="Dingo.pubsub._TopicTreeNode&#45;class.html#getNode" title="Return ref to node associated with subtopic" alt="" coords="17,204,311,223"/>
<area shape="rect" href="Dingo.pubsub._TopicTreeNode&#45;class.html#removeCallable" title="Remove weak callable from our node (and return True)." alt="" coords="17,223,311,241"/>
<area shape="rect" href="Dingo.pubsub._TopicTreeNode&#45;class.html#createSubtopic" title="Create a child node for subtopic" alt="" coords="17,241,311,260"/>
<area shape="rect" href="Dingo.pubsub._TopicTreeNode&#45;class.html" title="A node in the topic tree." alt="" coords="16,11,312,261"/>
</map>
  <img src="uml_class_diagram_for_dingo_pu.gif" alt='' usemap="#uml_class_diagram_for_dingo_pu" ismap="ismap" class="graph-without-title" />
</center></center>
<hr />
<p>A node in the topic tree. This contains a list of callables that are 
  interested in the topic that this node is associated with, and contains a
  dictionary of subtopics, whose associated values are other 
  _TopicTreeNodes. The topic of a node is not stored in the node, so that 
  the tree can be implemented as a dictionary rather than a list, for ease 
  of use (and, likely, performance).</p>
  Note that it uses _NodeCallback to encapsulate a callback for when a 
  registered listener dies, possible thanks to WeakRef. Whenever this 
  callback is called, the onDeadListener() function, passed in at 
  construction time, is called (unless it is None).<br /><br />

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="__init__"></a><span class="summary-sig-name">__init__</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">topicPath</span>,
        <span class="summary-sig-arg">onDeadListenerWeakCB</span>)</span></td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="getPathname"></a><span class="summary-sig-name">getPathname</span>(<span class="summary-sig-arg">self</span>)</span><br />
      The complete node path to us, ie., the topic tuple that would lead
      to us</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="createSubtopic"></a><span class="summary-sig-name">createSubtopic</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">subtopic</span>,
        <span class="summary-sig-arg">topicPath</span>)</span><br />
      Create a child node for subtopic</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="hasSubtopic"></a><span class="summary-sig-name">hasSubtopic</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">subtopic</span>)</span><br />
      Return true only if topic string is one of subtopics of this 
      node</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="getNode"></a><span class="summary-sig-name">getNode</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">subtopic</span>)</span><br />
      Return ref to node associated with subtopic</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="addCallable"></a><span class="summary-sig-name">addCallable</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">callable</span>)</span><br />
      Add a callable to list of callables for this topic node</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="getCallables"></a><span class="summary-sig-name">getCallables</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Get callables associated with this topic node</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="hasCallable"></a><span class="summary-sig-name">hasCallable</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">callable</span>)</span><br />
      Return true if callable in this node</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="sendMessage"></a><span class="summary-sig-name">sendMessage</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">message</span>)</span><br />
      Send a message to our callables</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="Dingo.pubsub._TopicTreeNode-class.html#removeCallable" class="summary-sig-name">removeCallable</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">callable</span>)</span><br />
      Remove weak callable from our node (and return True).</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="Dingo.pubsub._TopicTreeNode-class.html#clearCallables" class="summary-sig-name">clearCallables</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Abandon list of callables to caller.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="__notifyDead"></a><span class="summary-sig-name">__notifyDead</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">dead</span>)</span><br />
      Gets called when a listener dies, thanks to WeakRef</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="__cleanupDead"></a><span class="summary-sig-name">__cleanupDead</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Remove all dead objects from list of callables</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="__str__"></a><span class="summary-sig-name">__str__</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Print us in a not-so-friendly, but readable way, good for 
      debugging.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="_TopicTreeNode__cleanupDead"></a><span class="summary-sig-name">_TopicTreeNode__cleanupDead</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Remove all dead objects from list of callables</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="_TopicTreeNode__notifyDead"></a><span class="summary-sig-name">_TopicTreeNode__notifyDead</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">dead</span>)</span><br />
      Gets called when a listener dies, thanks to WeakRef</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="removeCallable"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">removeCallable</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">callable</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  Remove weak callable from our node (and return True). Does nothing if 
  not here (and returns False).
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="clearCallables"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">clearCallables</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  Abandon list of callables to caller. We no longer have any callables 
  after this method is called.
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="Dingo-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/dingo-wsn/">Dingo</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    <a href="epydoc-log.html">Generated by Epydoc
    3.0beta1 on Tue Jun  3 00:42:56 2008</a>
    </td>
    <td align="right" class="footer">
      <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie()
  // -->
</script>
  
</body>
</html>
